
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:massagist/models/path_model_entity.dart';
import 'package:massagist/pages/path_info_page.dart';

class PathItem extends StatelessWidget {
  PathModelEntity model;
  PathItem({required this.model});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        height: 261.sp,
        child: Column(
          children: [
            Container(
              width: double.infinity,
              height: 200.sp,
              child: ClipRRect(
                borderRadius: BorderRadius.circular(8.sp),
                child: Image.network(
                  model.icon, fit: BoxFit.cover,
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 8.sp),
              height: 37.sp,
              alignment: Alignment.topLeft,
              child: Text(
                model.line,
                maxLines: 2,
                style: TextStyle(
                  fontWeight: FontWeight.w700, fontSize: 13.sp, color: Color(0xFF333333)
                ),
              ),
            )
          ],
        ),
      ),
      onTap: () {
        Navigator.push(
          context,
          MaterialPageRoute(builder: (context) =>  PathInfoPage(model: this.model,)),
        );
      },
    );
  }

  String getAllPath() {
    String result = ")";
    return result;
  }
}